﻿using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System;

namespace HobSoft.SoccerBet2014.Domain.Models
{
    using Core;
    using KeyHelper;
    [Serializable]
    [DataContract]
    public class BFRunner : IModel
    {
        [PrimaryKey]
        [DataMember(IsRequired = true)]
        public string Key
        {
            get { return KeyGenerateHelper.Create<BFRunner>(this); }
            set {  }
        }
        
        private string _marketID;
        [Key]
        [Required]
        [MaxLength(50)]
        [MinLength(1)]
        [DataMember(IsRequired = true)]
        public string MarketID
        {
            get { return _marketID; }
            set { _marketID = value; }
        }

        private int _selectionID;
        [Key]
        [Required]
        [DataMember(IsRequired = true)]
        public int SelectionID
        {
            get { return _selectionID; }
            set { _selectionID = value; }
        }

        private byte _orderIndex;
        [Required]
        [DataMember(IsRequired = true)]
        public byte OrderIndex
        {
            get { return _orderIndex; }
            set { _orderIndex = value; }
        }

        private decimal _handicap;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal Handicap
        {
            get { return _handicap; }
            set { _handicap = value; }
        }

        private string _runnerName;
        [Required]
        [MaxLength(300)]
        [DataMember(IsRequired = true)]
        public string RunnerName
        {
            get { return _runnerName; }
            set { _runnerName = value; }
        }

        private int _asianLineId;
        [Required]
        [DataMember(IsRequired = true)]
        public int AsianLineId
        {
            get { return _asianLineId; }
            set { _asianLineId = value; }
        }

        private decimal _totalMatched;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal TotalMatched
        {
            get { return _totalMatched; }
            set { _totalMatched = value; }
        }

        private decimal _lastPrice;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LastPrice
        {
            get { return _lastPrice; }
            set { _lastPrice = value; }
        }

        private decimal _lP1;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LP1
        {
            get { return _lP1; }
            set { _lP1 = value; }
        }

        private decimal _lP2;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LP2
        {
            get { return _lP2; }
            set { _lP2 = value; }
        }

        private decimal _lP3;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LP3
        {
            get { return _lP3; }
            set { _lP3 = value; }
        }

        private decimal _bP1;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal BP1
        {
            get { return _bP1; }
            set { _bP1 = value; }
        }

        private decimal _bP2;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal BP2
        {
            get { return _bP2; }
            set { _bP2 = value; }
        }

        private decimal _bP3;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal BP3
        {
            get { return _bP3; }
            set { _bP3 = value; }
        }

        private decimal _lA1;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LA1
        {
            get { return _lA1; }
            set { _lA1 = value; }
        }

        private decimal _lA2;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LA2
        {
            get { return _lA2; }
            set { _lA2 = value; }
        }

        private decimal _lA3;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal LA3
        {
            get { return _lA3; }
            set { _lA3 = value; }
        }

        private decimal _bA1;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal BA1
        {
            get { return _bA1; }
            set { _bA1 = value; }
        }

        private decimal _bA2;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal BA2
        {
            get { return _bA2; }
            set { _bA2 = value; }
        }

        private decimal _bA3;
        [Required]
        [DataMember(IsRequired = true)]
        public decimal BA3
        {
            get { return _bA3; }
            set { _bA3 = value; }
        }

        [IgnoreDataMember]
        public BFMarket Market
        {
            get;
            set;
        }
    }
}
